﻿var speed=30
var Sdemoh0 = document.getElementById("demoh0");
var Sdemoh1 = document.getElementById("demoh1");
var Sdemoh2 = document.getElementById("demoh2");
function Marqueeh(){
 if(Sdemoh2.offsetHeight-Sdemoh0.scrollTop<=0)
  Sdemoh0.scrollTop-=Sdemoh1.offsetHeight
 else{
  Sdemoh0.scrollTop++
 }
}
Sdemoh2.innerHTML=Sdemoh1.innerHTML
var MyMarh=setInterval(Marqueeh,speed)
Sdemoh0.onmouseover=function(){ clearInterval(MyMarh) }
Sdemoh0.onmouseout=function(){ MyMarh=setInterval(Marqueeh,speed) }